package com.qfedu.meidijiaju.controller;


import com.qfedu.meidijiaju.common.ResponseData;
import com.qfedu.meidijiaju.entity.HuatiYxy;
import com.qfedu.meidijiaju.service.HuatiYxyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 话题 前端控制器
 * </p>
 *
 * @author meidimeiju
 * @since 2022-10-03
 */
@Api(tags = "话题相关模块")
@RestController
@RequestMapping("/meidijiaju/huati-yxy")
public class HuatiYxyController {


    @Autowired
    private HuatiYxyService huatiYxyService;

    @ApiOperation(value = "/查询所有话题/推荐话题")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "contentOrTitle",value = "内容或者标题",paramType = "query",dataType = "string")
//    })
    @RequestMapping(value = "/queryAllHuaTi",method = RequestMethod.GET)
    public ResponseData<List<HuatiYxy>> queryAllHuaTi(){

        return huatiYxyService.queryAllHuaTi();
    }

    @ApiOperation(value = "/根据话题名字模糊查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "huaTiName",value = "模糊话题名字",paramType = "query",dataType = "string")
    })
    @RequestMapping(value = "/findHuaTiByHuaTiName",method = RequestMethod.GET)
    public ResponseData<List<HuatiYxy>> findHuaTiByHuaTiName(String huaTiName){

        return huatiYxyService.findHuaTiByHuaTiName(huaTiName);

    }

}

